#include <bits/stdc++.h>
using namespace std;
const int MAXN=100005;
int a[MAXN];
int n,k,f;
int read(){
    int x=0;char c=getchar();int f=1;
    for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
    for(; isdigit(c);c=getchar()) x=(x<<3) + (x<<1) + (c^48);
    return x*f;
}
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=read();
    int MAXL=0;
    for(int i=1;i<=n;i++)
    {
        k=read();
        a[k]++;
        if(k>MAXL) MAXL=k;
        if(k>2) f=1;
        else k=0;
    }
    if(f==0) cout<<a[1];
    else
    {
        int m=0;
    int j=1;
    while(m<=MAXL)
    {
        if(a[m]!=0)
        {
            a[j]=a[m];
            j++;
        }
        m++;
    }
    int l=1;
    int r=2;
    int f=1;
    int i=1;
    int cnt=0;
    for(int i=1;i<j;i++)
    {
            if(i<=l) continue;
            else
            {
                if(r>l){
                    if(a[l]<=a[r])a[l]=0;
                    else a[l]-=a[r];
                }
                l=r;
                r=i+1;
            }


    }
    for(int i=1;i<=j;i++)  {cnt+=a[i];}
    cout<<cnt;
    }
}
